#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
	int t = 0;
	cin >> t;
	while (t--)
	{
		int n, s, m;
		scanf("%d %d %d", &n, &s, &m);
		int a = 0;
		vector<vector<int>> dp(n, vector<int>(2));
		for (int i = 0;i < n;i++)
		{
			for (int j = 0;j < 2;j++)
			{
				scanf("%d", &dp[i][j]);
			}
		}
		sort(dp.begin(), dp.end());
		int left = 0;
		for (auto e : dp)
		{
			if (e[0] - left >= s)
			{
				printf("YES\n");
				a = 1;
				break;
			}
			left = e[1];
		}
		int right = m;
		if (a == 0 && right - left >= s)
		{
			printf("YES\n");
			a = 1;
		}
		if (a == 0) printf("NO\n");
	}
	return 0;
}